/*
 * @Author: zhengzhuang
 * @Date: 2020-05-16 15:28:14
 * @LastEditors: zhengzhuang
 * @LastEditTime: 2020-08-28 17:24:46
 * @Description: 车主入驻介绍
 * @FilePath: /C20Driver/lib/pages/taxi_driver_application/driver_registration.dart
 */
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:C20Driver/routers/navigator_util.dart';

class DriverRegistration extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('车主入驻'),
        elevation: 0,
      ),
      body: Container(
        alignment: Alignment.topCenter,
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height,
        color: Color(0xffEFF3F9),
        child: Stack(
          // alignment: Alignment.topLeft,
          children: <Widget>[
            Positioned(
              top: 0,
              child: Image.asset(
                'assets/icon/registeredAdvertisementIcon.png',
                width: ScreenUtil().setWidth(750.0),
                height: ScreenUtil().setWidth(400),
              ),
            ),
            Positioned(
              top: ScreenUtil().setWidth(316),
              child: Column(
                children: [
                  _toRegister(
                      title: '成为网约车车主',
                      des: '有车无车都能跑，时间灵活，赚钱自由',
                      context: context,
                      type: '0010'),
                  SizedBox(height: ScreenUtil().setWidth(30.0)),
                  _toRegister(
                      title: '注册顺风车车主',
                      des: '顺路也能赚钱，赶快成为顺风车车主吧！',
                      context: context,
                      type: '0020'),
                ],
              ),
            )
          ],
        ),
      ),
    );
  }

  /// 成为网约车司机
  /// type ==> 0010 网约车
  /// type ==> 0020 顺风车
  Widget _toRegister(
      {String title, String des, BuildContext context, String type}) {
    return Container(
      width: ScreenUtil().setWidth(686.0),
      padding: EdgeInsets.all(ScreenUtil().setWidth(32.0)),
      margin: EdgeInsets.fromLTRB(ScreenUtil().setWidth(32), 0, 0, 0),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(24.0),
      ),
      child: Column(
        children: <Widget>[
          Container(
            alignment: Alignment.centerLeft,
            child: Text(
              "$title",
              style: TextStyle(
                fontSize: ScreenUtil().setSp(32.0),
                fontWeight: FontWeight.w500,
              ),
            ),
          ),
          SizedBox(
            height: ScreenUtil().setWidth(24.0),
          ),
          Container(
            alignment: Alignment.centerLeft,
            child: Text(
              "$des",
              style: TextStyle(
                color: Color(0xff999999),
                fontSize: ScreenUtil().setSp(30.0),
              ),
            ),
          ),
          SizedBox(
            height: ScreenUtil().setWidth(48.0),
          ),
          InkWell(
            child: Container(
              width: ScreenUtil().setWidth(686),
              alignment: Alignment.center,
              height: ScreenUtil().setWidth(84),
              decoration: BoxDecoration(
                  color: Color(0xff3FB956),
                  borderRadius:
                      BorderRadius.circular(ScreenUtil().setWidth(42))),
              child: Text(
                "立即注册",
                style: TextStyle(
                    color: Color(0xffFFFFFF),
                    fontSize: ScreenUtil().setSp(30),
                    fontWeight: FontWeight.w500),
              ),
            ),
            onTap: () => NavigatorUtil.jump(
                context, '/publicityIntroduction?type=$type'),
          )
        ],
      ),
    );
  }
}
